import React, { Component } from 'react';
import Tabbar from "./components/tabbar"
/* 1. 引入路由的组件 */
import { HashRouter as Router,Route,Redirect} from "react-router-dom"
/* 2. 引入对应的组件 */
import Home from "./components/home"
import House from "./components/house"
import Info from "./components/info"
import My from "./components/my"

class App extends Component {
  render() {
    return (
      /* 2. Router 配置根节点处 */
      <Router>
        <Route path="/" exact render={()=><Redirect to="/index"></Redirect>}></Route>
        <Route path="/index" render={(props)=><Tabbar {...props} type="index"><Home></Home></Tabbar>}></Route>
        <Route path="/house" render={(props)=><Tabbar {...props} type="house"><House></House></Tabbar>}></Route>
        <Route path="/info" render={(props)=><Tabbar {...props} type="info"><Info></Info></Tabbar>}></Route>
        <Route path="/my" render={(props)=><Tabbar {...props} type="my"><My></My></Tabbar>}></Route>
      </Router> 
    );
  }
}

export default App;
